package com.example.projecth;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;

public class MainActivity extends Activity {
	
	private ImageButton[] button;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		button = new ImageButton[5];
		button[0] = (ImageButton)findViewById(R.id.button1);
		button[1] = (ImageButton)findViewById(R.id.button2);
		button[2] = (ImageButton)findViewById(R.id.button3);
		button[3] = (ImageButton)findViewById(R.id.button4);
		button[4] = (ImageButton)findViewById(R.id.button5);
		
		for (int i = 0; i < button.length; i++) {
			button[i].setOnClickListener(new OnClickListener() {
				
				Intent intent;
								
				@Override
				public void onClick(View v) {
					
					switch (v.getId()) {
					case R.id.button1 : 
						intent = new Intent(MainActivity.this, com.example.projecth.medicalcheckup.IntroActivity.class);
						startActivity(intent); 
						break;
					case R.id.button2 : 
						intent = new Intent(MainActivity.this, com.example.projecth.runhelper.IntroActivity.class);
						startActivity(intent);
						break;
					case R.id.button3 :
						intent = new Intent(MainActivity.this, com.example.projecth.project3.IntroActivity.class);
						startActivity(intent);
						break;
					case R.id.button4 :
						intent = new Intent(MainActivity.this, com.example.projecth.water2.IntroActivity.class);
						startActivity(intent);
						break;
					case R.id.button5 : 
						intent = new Intent(MainActivity.this, com.example.projecth.projecthealth.MainActivity.class);
						startActivity(intent);
						break;
					}
					
				}
			});
		}
		
	}

	

}
